/**
 * 
 */
package com.social.itba.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author waabox ( emiliano[dot]arango[at]globat[dot]com )
 * 
 */
public class ExampleServlet extends HttpServlet {
  /**
   * Java serial version. 
   */
  private static final long serialVersionUID = -9182941551336900778L;
  /**
   * @see
   * javax.servlet.http.HttpServlet#doDelete(
   *  javax.servlet.http.HttpServletRequest,
   *  javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void doDelete(final HttpServletRequest request,
      final HttpServletResponse response)
      throws ServletException, IOException {
    String parameter = request.getParameter("parameter");
    response.setContentType("text/plain");
    response.getWriter().write("using doDelete method. parameter=" + parameter);
  }
  /**
   * @see
   * javax.servlet.http.HttpServlet#doGet(
   *  javax.servlet.http.HttpServletRequest,
   *  javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void doGet(final HttpServletRequest request,
      final HttpServletResponse response)
      throws ServletException, IOException {
    String parameter = request.getParameter("parameter");
    response.setContentType("text/plain");
    response.getWriter().write("using doGet method. parameter=" + parameter);
  }
  /**
   * @see
   * javax.servlet.http.HttpServlet#doPost(
   *  javax.servlet.http.HttpServletRequest,
   *  javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void doPost(final HttpServletRequest request,
      final HttpServletResponse response)
      throws ServletException, IOException {
    String parameter = request.getParameter("parameter");
    response.setContentType("text/plain");
    response.getWriter().write("using doPost method. parameter=" + parameter);
  }
  /**
   * @see javax.servlet.http.HttpServlet#doPut(
   *  javax.servlet.http.HttpServletRequest,
   *  javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void doPut(final HttpServletRequest request,
      final HttpServletResponse response)
      throws ServletException, IOException {
    String parameter = request.getParameter("parameter");
    response.setContentType("text/plain");
    response.getWriter().write("using doPut method. parameter=" + parameter);
  }
}
